<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body class="page1">
    <div></div>
    <script>
        /**
         * matches('css选择符')
         * 检测某个元素是否可以被queryselector和queryselectorall方法返回
        */

        if (document.body.matches("body.page1")) {
            console.log('true')
        }
    </script>
</body>
</html>